import 'package:json_annotation/json_annotation.dart';

import 'line_style.dart';

part 'axis_pointer.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class AxisPointLabel {
  //tooltip 中的label
  var show;
  var precision;
  var formatter;
  var margin;
  var color;
  var fontStyle;
  var fontWeight;
  var fontFamily;
  var fontSize;
  var lineHeight;
  var width;
  var height;
  var textBorderColor;
  var textBorderWidth;
  var textBorderType;
  var textBorderDashOffset;
  var textShadowColor;
  var textShadowBlur;
  var textShadowOffsetX;
  var textShadowOffsetY;
  var overFlow;
  var ellipsis;
  var lineOverflow;
  var padding;
  var backgroundColor;
  var borderColor;
  var borderWidth;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;

  AxisPointLabel(
      {this.show,
      this.precision,
      this.formatter,
      this.margin,
      this.color,
      this.fontStyle,
      this.fontWeight,
      this.fontFamily,
      this.fontSize,
      this.lineHeight,
      this.width,
      this.height,
      this.textBorderColor,
      this.textBorderWidth,
      this.textBorderType,
      this.textBorderDashOffset,
      this.textShadowColor,
      this.textShadowBlur,
      this.textShadowOffsetX,
      this.textShadowOffsetY,
      this.overFlow,
      this.ellipsis,
      this.lineOverflow,
      this.padding,
      this.backgroundColor,
      this.borderColor,
      this.borderWidth,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY});

  factory AxisPointLabel.fromJson(Map<String, dynamic> json) =>
      _$AxisPointLabelFromJson(json);

  Map<String, dynamic> toJson() => _$AxisPointLabelToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ShadowStyle {
  var color;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;

  ShadowStyle(
      {this.color,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity});

  factory ShadowStyle.fromJson(Map<String, dynamic> json) =>
      _$ShadowStyleFromJson(json);

  Map<String, dynamic> toJson() => _$ShadowStyleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Handle {
  var show;
  var icon;
  var size;
  var margin;
  var color;
  var throttle;

  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;



  Handle(
      {this.show,
      this.icon,
      this.size,
      this.margin,
      this.color,
      this.throttle,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity});

  factory Handle.fromJson(Map<String, dynamic> json) => _$HandleFromJson(json);

  Map<String, dynamic> toJson() => _$HandleToJson(this);

}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class AxisPointer {
//都有
  var show;
  var type;
  var snap;
  var z;
  AxisPointLabel? label;
  LineStyle? lineStyle;
  ShadowStyle? shadowStyle;

  //tooptip中的AxisPoint;
  LineStyle? crossStyle;
  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  //option中的AxisPoint;
  var id;
  var triggerTooltip;
  var value;
  var status;
  Handle? handle;
  var link;
  var triggerOn;


  AxisPointer(
      {this.show,
      this.type,
      this.snap,
      this.z,
      this.label,
      this.lineStyle,
      this.shadowStyle,
      this.crossStyle,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate,
      this.id,
      this.triggerTooltip,
      this.value,
      this.status,
      this.handle,
      this.link,
      this.triggerOn});

  factory AxisPointer.fromJson(Map<String, dynamic> json) =>
      _$AxisPointerFromJson(json);

  Map<String, dynamic> toJson() => _$AxisPointerToJson(this);
}
